import React, { lazy, Suspense } from 'react';
import { Router, Route, Switch } from 'dva/router';
import PropTypes from 'prop-types';
// import App from './routes/app';
// import Demo from './routes/exam/demo'
// import Demo1 from './routes/exam/demo1'
import Intl from './Intl';

const App = lazy(()=>import("./routes/app"))
const Demo = lazy(()=>import("./routes/exam/demo"))
const Demo1 = lazy(()=>import("./routes/exam/demo1"))

const Routers = ({ history }) => {
  return (
    <Intl>
      <Suspense fallback={"hello"}>
      <Router history={history}>
        <Switch>
          <Route path="/" exact component={App} />
          <Route path="/Demo" exact component={Demo} />
          <Route path="/Demo1" exact component={Demo1} />

        </Switch>
      </Router>
      </Suspense>
    </Intl>
  );
};
Routers.propTypes = {
  history: PropTypes.object,
};

export default Routers;
